package com.xx.service;

import com.xx.dao.UserDao;
import com.xx.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 许欣
 * 时间：2022/4/26 20:00
 * 描述：
 */
@Service("userService")
public class UserServiceImpl implements UserService{


    @Autowired
    private UserDao userDao;

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    @Override
    public int add(User user) {
        return userDao.add(user);
    }

    @Override
    public User getById(Integer id) {
        return userDao.getById(id);
    }

    @Override
    public int update(User user) {
        return userDao.update(user);
    }

    @Override
    public List<User> getAll() {

        return userDao.getAll();
    }

    @Override
    public User getByAccount(String account) {
        return userDao.getByAccount(account);
    }

    @Override
    public int delete(Integer id) {
        return userDao.delete(id);
    }

    @Override
    public void log() {
        System.out.println("进入");
    }
}
